net: make holding the buffer in memory more robust (v4.x backport)#8300
Closed
addaleax wants to merge 1 commit intonodejs:v4.x-stagingfrom
Closed
net: make holding the buffer in memory more robust (v4.x backport)#8300addaleax wants to merge 1 commit intonodejs:v4.x-stagingfrom
addaleax wants to merge 1 commit intonodejs:v4.x-stagingfrom
Conversation
Set the `req.buffer` property, which serves as a way of keeping a `Buffer` alive that is being written to a stream, on the C++ side instead of the JS side. This closes a hole where buffers that were temporarily created in order to write strings with uncommon encodings (e.g. `hex`) were passed to the native side without being set as `req.buffer`. Fixes: nodejs#8251 PR-URL: nodejs#8252 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Member
Author
Member
|
Some red in CI unfortunately. |
Member
Author
Member
Author
|
It’s all mostly been buildbot failures so far, nothing related, but let’s see if we can get a green CI: https://ci.nodejs.org/job/node-test-commit/4833/ |
Member
|
Green! LGTM! |
Contributor
|
LGTM |
Contributor
|
landed in bceac33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set the
req.bufferproperty, which serves as a way of keepinga
Bufferalive that is being written to a stream, on the C++side instead of the JS side.
This closes a hole where buffers that were temporarily created
in order to write strings with uncommon encodings (e.g.
hex)were passed to the native side without being set as
req.buffer.Fixes: #8251
PR-URL: #8252
(@thealphanerd my instinct has become to automatically assign v4.x backports to you, in part because that makes it very easy to discern them visually in PR lists… if you think that’s cool I’ll keep doing it?)